package com.example.hotelmanagement.service.impl;

import com.example.hotelmanagement.entity.Reservation;
import com.example.hotelmanagement.mapper.ReservationMapper;
import com.example.hotelmanagement.service.ReservationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ReservationServiceImpl implements ReservationService {

    @Autowired
    private ReservationMapper reservationMapper;

    @Override
    public List<Reservation> findAll() {
        return reservationMapper.findAll();
    }

    @Override
    public Reservation findById(Integer reservationId) {
        return reservationMapper.findById(reservationId);
    }

    @Override
    public List<Reservation> findByRoomId(Integer roomId) {
        return reservationMapper.findByRoomId(roomId);
    }

    @Override
    public List<Reservation> findByStatus(String status) {
        return reservationMapper.findByStatus(status);
    }

    @Override
    public int save(Reservation reservation) {
        return reservationMapper.insert(reservation);
    }

    @Override
    public int update(Reservation reservation) {
        return reservationMapper.update(reservation);
    }

    @Override
    public int delete(Integer reservationId) {
        return reservationMapper.delete(reservationId);
    }
}